package LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-05-10
 * Time: 10:19
 */
public class MyLinkedListTest {

    public static void main5(String[] args) {
        MyLinkedList list = new MyLinkedList();
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        list.addLast(5);
        list.display();
        System.out.println("=============");
        list.remove(1);
        list.remove(2);
        list.remove(3);
        list.remove(4);
        list.remove(5);
        list.display();
        list.clear();
    }


    public static void main(String[] args) {
        MyLinkedList list = new MyLinkedList();
        list.addLast(5);
        list.addLast(5);
        list.addLast(5);
        list.addLast(5);
        list.addLast(5);
        list.display();
        list.removeAllKey(5);
        list.display();

    }



    public static void main3(String[] args) {
        MyLinkedList list = new MyLinkedList();
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        list.addLast(5);
        list.display();
        System.out.println("=============");
        list.remove(1);
        list.remove(2);
        list.remove(3);
        list.remove(4);
        list.remove(7);
        list.display();
      //  list.remove(5);


    }

    public static void main2(String[] args) {
        MyLinkedList list = new MyLinkedList();
        list.addFirst(1);
        list.addFirst(2);
        list.addFirst(3);
        list.addFirst(14);
        list.addFirst(15);
        list.addFirst(6);
        list.addFirst(91);
        list.display();
        System.out.println("=================");
        System.out.println(list.contains(1));
        System.out.println(list.contains(14));
        System.out.println(list.contains(3));
        System.out.println(list.contains(2));
        System.out.println(list.contains(91));
        System.out.println("==================");



    }




    public static void main1(String[] args) {
        MyLinkedList list = new MyLinkedList();
//        list.addFirst(1);
//        list.addFirst(2);
//        list.addFirst(3);
//        list.addFirst(4);
//        list.addFirst(5);
//        list.addLast(9);
//        list.addLast(10);
//        list.addLast(11);
//        list.addLast(12);
//        list.addLast(13);
//        list.addIndex(0,1);
//        list.addIndex(0,1);
//        list.addIndex(0,1);
//        list.addIndex(0,1);
//        list.addIndex(1,1);

        list.display();
    }

}
